#ifndef __CLIENT_H__
#define __CLIENT_H__
#include "Socket.h"

class Client : public Socket
{
private:
    //用于维持与服务器端通信的句柄
    socketfd skf_;
    struct sockaddr_in *ser_addr;

private:
    int createConnection(struct sockaddr *serv_addr, size_t addr_len, int time);

public:
    Client(int mode, int port, char *ip_addr, int timeout = 0);
    ~Client();

public:
    void setIP(char *ip_addr, int timeout = 0);
    int sendMsg(char *buff, int length);
    int receiveMsg();
};
#endif